package edu.sctu.practice.zhengsenwen.assign.assign02;

import edu.sctu.practice.zhengsenwen.Constant;

/**
 * Created by user15 on 2015/10/8.
 */
public class Circle {

    private float radius;
    public float square = 0;
    public static int numOfObjects = 0;


    public Circle(float radius) {
        this.radius = radius;
    }

    public float getSquare() {
        square = Constant.PI * radius * radius;
        return square;
    }

    public static void printCircle(Circle circle) {

        System.out.println("第" + numOfObjects + "个");
        System.out.println("半径" + circle.radius);
        System.out.println("面积" + circle.getSquare());
        System.out.println();
        numOfObjects++;
    }

}

